{extend name='base/form_base' /}

{block name='content'}
<div class="layui-fluid">
  <form class="layui-form" id="edit_form" onsubmit="return false">
        <input type="hidden" name="id" value="{$data.id ?? ''}">
        <div class="layui-form-item">
              <label class="layui-form-label">等级：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.level ?? ''}" class="layui-input" readonly="">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">名称 ：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.name ?? ''}" class="layui-input" name="name">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">销售一代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.one ?? ''}" class="layui-input" name="one">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">销售二代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.two ?? ''}" class="layui-input" name="two">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">销售三代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.three ?? ''}" class="layui-input" name="three">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">销售四代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.four ?? ''}" class="layui-input" name="four">
              </div>
        </div>
      
        
        <div class="layui-form-item">
              <label class="layui-form-label">佣金一代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.static_one ?? ''}" class="layui-input" name="static_one">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">佣金二代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.static_two ?? ''}" class="layui-input" name="static_two">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">佣金三代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.static_three ?? ''}" class="layui-input" name="static_three">
              </div>
        </div>
        <div class="layui-form-item">
              <label class="layui-form-label">佣金四代：</label>
              <div class="layui-input-inline">
                <input type="text" value="{$data.static_four ?? ''}" class="layui-input" name="static_four">
              </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" onclick="ajax()" lay-filter="formDemo">提交</button>
          </div>
        </div>
  </form>
</div>  
{/block}
{block name="script"}
<script type="text/javascript">
function ajax(el){
  var post_data = $("#edit_form").serialize();
  // post_data = post_data+'&el='+el;
  $.ajax({
      url:"{:url('admin/invest/editLevel')}",
      type:"POST",
      data:post_data,
      success:function(ret){
          if (ret.code == 0) {
            layer.msg('操作成功');
            window.parent.location.reload();
          }
          if (ret.code == 1) {
              layer.msg(ret.msg);
          }
      }
  });
}
</script> 
{/block}